Repository navigation
Conversation
- The WebSocket engine replaces the query string of any URL quoted in a socket error with <redacted> before the error reaches the logs or the reported StreamNetworkException. An error that quotes no URL query passes through unchanged. - LoggingInterceptor reports the Authorization header as <redacted>. - UserToken.toString() and the missing-user_id ArgumentError no longer include the raw token. - The WebSocketOptions dartdoc example no longer puts a token in the query parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine now hands a redacted error to the client as a plain Exception, so the client still wraps it with its own message and cause. UserToken also re-throws JWT parser errors without the value, the redaction is documented on the engine and on requestHeader, and the tests use the error shape dart:io produces. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the URL-query scrubbing with a type-based mapping: a package:web_socket WebSocketException, the one error whose text can quote the connection URL, reaches the client as an exception reading "The WebSocket connection failed". Other errors pass through unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #261 +/- ##
==========================================
+ Coverage 75.13% 75.64% +0.50%
==========================================
Files 220 224 +4
Lines 9563 9804 +241
==========================================
+ Hits 7185 7416 +231
- Misses 2378 2388 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A value jose cannot parse is no working token, so its parse errors are left as they are. The missing user_id error and toString() still leave out the raw value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Modelled on OkHttp's HttpLoggingInterceptor: the values of the named headers (request and response) and query parameters are reported as "██", matching names regardless of case. redactHeaders defaults to Authorization; an empty set reports every header as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…xception - Any WebSocketChannelException wrapping another error (every failure to open, including dart:io's HttpException that quotes the URL) is reported as a StreamNetworkException reading "The WebSocket connection failed". The web_socket dependency is no longer needed. - LoggingInterceptor: redactedHeaders / redactedQueryParameters and a public defaultRedactedHeaders, matched through a case-insensitive set by small _redactHeader / _redactQueryParameter / _redactUrl helpers. Log output is unchanged. - UserToken.toString() uses objectRuntimeType; docs and CHANGELOG follow the review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine passes socket failures through untouched again, and the client keeps wrapping them as a StreamNetworkException with the original error as its cause, the shape OkHttp and the Android SDK use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restores the engine change: dart:io quotes the connection URL in the errors it raises while connecting, so a WebSocketChannelException wrapping another error is reported as a StreamNetworkException reading "The WebSocket connection failed". This gives the engine the guarantee OkHttp's transport has by construction: its errors carry no URL. LoggingInterceptor now redacts URL query parameters in the raw query, keeping order and encoding of the rest, and matches decoded names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like OkHttp, ws and Python's websockets, the engine reports a failed open as the transport raised it, and the client wraps it with the original as its cause. Credentials leaving the URL (first-message auth) is what keeps them out of those errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matching stays case-insensitive; a test covers a lowercase header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also types defaultRedactedHeaders as Iterable<String> and tightens the constructor docs and changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of FLU-1379
What
LoggingInterceptor: gainsredactedHeadersandredactedQueryParameters, modelled on OkHttp'sHttpLoggingInterceptor(redactHeader/redactQueryParams). Named request and response headers and query parameters are logged as***, matched regardless of case; in URLs only the named values change, keeping parameter order and encoding.redactedHeadersdefaults todefaultRedactedHeaders(Authorization); spread it in to add more, or pass an empty collection to log every header as is.UserToken:toString()leaves out the raw value, and theArgumentErrorfor a token without auser_idno longer includes it.Verified
dart analyze --fatal-infosand all 986stream_coretests pass, including a query parameter whose name isn't valid UTF-8.main; with redaction on it matches the output before the refactor of the redaction code.🤖 Generated with Claude Code